package com.meessiom.train.crm.product.repository;

import com.meessiom.train.crm.course.model.Course;
import com.meessiom.train.crm.product.model.Product;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.sql.Time;
import java.util.List;


@Repository
public interface ProductRepository extends JpaRepository<Product,Long>,JpaSpecificationExecutor {
    @Query(value = "select product_name from customers where id = ?",nativeQuery = true)
    public String getProductNameByCourseId(long id);


    public List<Product> findByProductNameLikeAndProductCompanyLikeAndProductTimeAndProductQualityLikeAndProductId

            (@Param("name") String name , @Param("id") String introduce , @Param("company") String credit,
             @Param("time") Time time, @Param("quality")String teacher);
}

